how to calculate macros